package yaohua.main;

import java.util.ArrayList;

import yaohua.main.BorrowItemActivity.RenewListener;
import android.app.AlertDialog;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.widget.Button;
import android.widget.SimpleAdapter;

public class ItemActivity extends ListActivity
	{
		@Override
		protected void onCreate(Bundle savedInstanceState)
			{
				super.onCreate(savedInstanceState);
				
				// 设置无标题
				requestWindowFeature(Window.FEATURE_NO_TITLE);
				// 从intent中获取数据

				Intent intent = getIntent();
				ArrayList listItem = intent.getParcelableArrayListExtra("listItem");
				SimpleAdapter sa = new SimpleAdapter(this, listItem, android.R.layout.simple_list_item_2, new String[]
					{ "title", "value" }, new int[]
					{ android.R.id.text1, android.R.id.text2 });
				this.setListAdapter(sa);
				
			}
		@Override
		public boolean onOptionsItemSelected(MenuItem item)
			{
				new AlertDialog.Builder(this).setTitle("关于").setMessage("本程序为中北大学图书馆使用,欢迎您能向作者提供在使用过程中的bug,以方便作者进行修改.联系作者新浪微薄@耀华info")
						.show();
				return super.onOptionsItemSelected(item);
			}

		@Override
		public boolean onCreateOptionsMenu(Menu menu)
			{
				menu.add("关于");
				return super.onCreateOptionsMenu(menu);
			}

	}
